package com.naiterui.ehp.bs.ds.modules.sys.service.impl;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.naiterui.ehp.bs.ds.common.utils.PageVO;
import com.naiterui.ehp.bs.ds.common.vo.PageParamsVO;
import com.naiterui.ehp.bs.ds.modules.sys.entity.Log;
import com.naiterui.ehp.bs.ds.modules.sys.mapper.LogMapper;
import com.naiterui.ehp.bs.ds.modules.sys.service.ILogService;

@Service
@Transactional(rollbackFor = Exception.class)
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements ILogService {

    @Override
    public PageVO<Log> queryPage(PageParamsVO pageParamsVO, Log log) {
        IPage<Log> page = this.page(pageParamsVO.getPage(), pageParamsVO.getEntityWrapper(log));
        return PageVO.toPageVo(page);
    }

    @Async
    @Override
    public void saveLog(Log entity) {
        super.save(entity);
    }
}
